import forgery_py
from application import db
from application.users.models import Users
from werkzeug.security import generate_password_hash


def generate_user(count=200):
    for i in range(count):
        print(i)
        user = Users()

        user.fullname = forgery_py.name.full_name()
        user.username = forgery_py.internet.user_name()
        user.password = generate_password_hash('123456')
        db.session.add(user)
        try:
            db.session.commit()
        except Exception as e:
            db.session.rollback()
